stream {
    log_format main '$remote_addr $upstream_addr $time_local $status';
    access_log /var/log/nginx/k8s-access.log main;
    upstream k8s-apiserver {
        {% for ip in groups['k8s_master'] %}
         server {{ hostvars[ip].inventory_hostname }}:6443;
        {% endfor %}
    }
    server {
        listen 6443;
        proxy_pass k8s-apiserver;
    }
}
